﻿<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
      <title>RecyclableMemoryStream 类
 | Fantasy.Net API Reference </title>
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <meta name="title" content="RecyclableMemoryStream 类
 | Fantasy.Net API Reference ">
      
      <link rel="icon" href="../favicon.ico">
      <link rel="stylesheet" href="../public/docfx.min.css">
      <link rel="stylesheet" href="../public/main.css">
      <meta name="docfx:navrel" content="../toc.html">
      <meta name="docfx:tocrel" content="toc.html">
      
      <meta name="docfx:rel" content="../">
      
      
      
  </head>

  <script type="module">
    import options from './../public/main.js'
    import { init } from './../public/docfx.min.js'
    init(options)
  </script>

  <script>
    const theme = localStorage.getItem('theme') || 'auto'
    document.documentElement.setAttribute('data-bs-theme', theme === 'auto' ? (window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light') : theme)
  </script>

  <body class="tex2jax_ignore" data-layout="" data-yaml-mime="ManagedReference">
    <header class="bg-body border-bottom">
      <nav id="autocollapse" class="navbar navbar-expand-md" role="navigation">
        <div class="container-xxl flex-nowrap">
          <a class="navbar-brand" href="../index.html">
            <img id="logo" class="svg" src="../logo.svg" alt="Fantasy.Net">
            Fantasy.Net
          </a>
          <button class="btn btn-lg d-md-none border-0" type="button" data-bs-toggle="collapse" data-bs-target="#navpanel" aria-controls="navpanel" aria-expanded="false" aria-label="Toggle navigation">
            <i class="bi bi-three-dots"></i>
          </button>
          <div class="collapse navbar-collapse" id="navpanel">
            <div id="navbar">
              <form class="search" role="search" id="search">
                <i class="bi bi-search"></i>
                <input class="form-control" id="search-query" type="search" disabled="" placeholder="搜索" autocomplete="off" aria-label="Search">
              </form>
            </div>
          </div>
        </div>
      </nav>
    </header>

    <main class="container-xxl">
      <div class="toc-offcanvas">
        <div class="offcanvas-md offcanvas-start" tabindex="-1" id="tocOffcanvas" aria-labelledby="tocOffcanvasLabel">
          <div class="offcanvas-header">
            <h5 class="offcanvas-title" id="tocOffcanvasLabel">Table of Contents</h5>
            <button type="button" class="btn-close" data-bs-dismiss="offcanvas" data-bs-target="#tocOffcanvas" aria-label="Close"></button>
          </div>
          <div class="offcanvas-body">
            <nav class="toc" id="toc"></nav>
          </div>
        </div>
      </div>

      <div class="content">
        <div class="actionbar">
          <button class="btn btn-lg border-0 d-md-none" style="margin-top: -.65em; margin-left: -.8em" type="button" data-bs-toggle="offcanvas" data-bs-target="#tocOffcanvas" aria-controls="tocOffcanvas" aria-expanded="false" aria-label="Show table of contents">
            <i class="bi bi-list"></i>
          </button>

          <nav id="breadcrumb"></nav>
        </div>

        <article data-uid="Fantasy.IO.RecyclableMemoryStream">



  <h1 id="Fantasy_IO_RecyclableMemoryStream" data-uid="Fantasy.IO.RecyclableMemoryStream" class="text-break">
    RecyclableMemoryStream 类
  
  </h1>

  <div class="facts text-secondary">
    <dl><dt>命名空间</dt><dd><a class="xref" href="Fantasy.html">Fantasy</a>.<a class="xref" href="Fantasy.IO.html">IO</a></dd></dl>
  <dl><dt>程序集</dt><dd>Fantasy.Net.dll</dd></dl>
  </div>

  <div class="markdown summary"></div>
  <div class="markdown conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public sealed class RecyclableMemoryStream : MemoryStream, IDisposable, IAsyncDisposable, IBufferWriter&lt;byte&gt;</code></pre>
  </div>




  <dl class="typelist inheritance">
    <dt>继承</dt>
    <dd>
      <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
      <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.marshalbyrefobject">MarshalByRefObject</a></div>
      <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a></div>
      <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.memorystream">MemoryStream</a></div>
      <div><span class="xref">RecyclableMemoryStream</span></div>
    </dd>
  </dl>

  <dl class="typelist implements">
    <dt>实现</dt>
    <dd>
      <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.idisposable">IDisposable</a></div>
      <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.iasyncdisposable">IAsyncDisposable</a></div>
      <div><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.buffers.ibufferwriter-1">IBufferWriter</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.byte">byte</a>&gt;</div>
    </dd>
  </dl>


  <dl class="typelist derived">
    <dt>继承成员</dt>
    <dd>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.memorystream.flush">MemoryStream.Flush()</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.memorystream.flushasync">MemoryStream.FlushAsync(CancellationToken)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.memorystream.readasync#system-io-memorystream-readasync(system-byte()-system-int32-system-int32-system-threading-cancellationtoken)">MemoryStream.ReadAsync(byte[], int, int, CancellationToken)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.memorystream.readasync#system-io-memorystream-readasync(system-memory((system-byte))-system-threading-cancellationtoken)">MemoryStream.ReadAsync(Memory&lt;byte&gt;, CancellationToken)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.memorystream.writeasync#system-io-memorystream-writeasync(system-byte()-system-int32-system-int32-system-threading-cancellationtoken)">MemoryStream.WriteAsync(byte[], int, int, CancellationToken)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.memorystream.writeasync#system-io-memorystream-writeasync(system-readonlymemory((system-byte))-system-threading-cancellationtoken)">MemoryStream.WriteAsync(ReadOnlyMemory&lt;byte&gt;, CancellationToken)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream.null">Stream.Null</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream.copyto#system-io-stream-copyto(system-io-stream)">Stream.CopyTo(Stream)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream.copytoasync#system-io-stream-copytoasync(system-io-stream)">Stream.CopyToAsync(Stream)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream.copytoasync#system-io-stream-copytoasync(system-io-stream-system-int32)">Stream.CopyToAsync(Stream, int)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream.copytoasync#system-io-stream-copytoasync(system-io-stream-system-threading-cancellationtoken)">Stream.CopyToAsync(Stream, CancellationToken)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream.dispose#system-io-stream-dispose">Stream.Dispose()</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream.disposeasync">Stream.DisposeAsync()</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream.flushasync#system-io-stream-flushasync">Stream.FlushAsync()</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream.beginread">Stream.BeginRead(byte[], int, int, AsyncCallback, object)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream.endread">Stream.EndRead(IAsyncResult)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream.readasync#system-io-stream-readasync(system-byte()-system-int32-system-int32)">Stream.ReadAsync(byte[], int, int)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream.readexactlyasync#system-io-stream-readexactlyasync(system-memory((system-byte))-system-threading-cancellationtoken)">Stream.ReadExactlyAsync(Memory&lt;byte&gt;, CancellationToken)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream.readexactlyasync#system-io-stream-readexactlyasync(system-byte()-system-int32-system-int32-system-threading-cancellationtoken)">Stream.ReadExactlyAsync(byte[], int, int, CancellationToken)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream.readatleastasync">Stream.ReadAtLeastAsync(Memory&lt;byte&gt;, int, bool, CancellationToken)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream.beginwrite">Stream.BeginWrite(byte[], int, int, AsyncCallback, object)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream.endwrite">Stream.EndWrite(IAsyncResult)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream.writeasync#system-io-stream-writeasync(system-byte()-system-int32-system-int32)">Stream.WriteAsync(byte[], int, int)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream.readexactly#system-io-stream-readexactly(system-span((system-byte)))">Stream.ReadExactly(Span&lt;byte&gt;)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream.readexactly#system-io-stream-readexactly(system-byte()-system-int32-system-int32)">Stream.ReadExactly(byte[], int, int)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream.readatleast">Stream.ReadAtLeast(Span&lt;byte&gt;, int, bool)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream.synchronized">Stream.Synchronized(Stream)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream.readtimeout">Stream.ReadTimeout</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream.writetimeout">Stream.WriteTimeout</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.marshalbyrefobject.getlifetimeservice">MarshalByRefObject.GetLifetimeService()</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.marshalbyrefobject.initializelifetimeservice">MarshalByRefObject.InitializeLifetimeService()</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object, object)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object, object)</a>
    </div>
    <div>
      <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a>
    </div>
  </dd></dl>

  <dl class="typelist extensionMethods">
    <dt>扩展方法</dt>
    <dd>
  <div>
      <a class="xref" href="Fantasy.Helper.JsonHelper.html#Fantasy_Helper_JsonHelper_ToJson__1___0_">JsonHelper.ToJson&lt;T&gt;(T)</a>
  </div>
  </dd></dl>





  <h2 class="section" id="constructors">构造函数
</h2>


  <a id="Fantasy_IO_RecyclableMemoryStream__ctor_" data-uid="Fantasy.IO.RecyclableMemoryStream.#ctor*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream__ctor_Fantasy_IO_RecyclableMemoryStreamManager_" data-uid="Fantasy.IO.RecyclableMemoryStream.#ctor(Fantasy.IO.RecyclableMemoryStreamManager)">
  RecyclableMemoryStream(RecyclableMemoryStreamManager)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public RecyclableMemoryStream(RecyclableMemoryStreamManager memoryManager)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>memoryManager</code> <a class="xref" href="Fantasy.IO.RecyclableMemoryStreamManager.html">RecyclableMemoryStreamManager</a></dt>
    <dd></dd>
  </dl>












  <a id="Fantasy_IO_RecyclableMemoryStream__ctor_" data-uid="Fantasy.IO.RecyclableMemoryStream.#ctor*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream__ctor_Fantasy_IO_RecyclableMemoryStreamManager_System_Guid_" data-uid="Fantasy.IO.RecyclableMemoryStream.#ctor(Fantasy.IO.RecyclableMemoryStreamManager,System.Guid)">
  RecyclableMemoryStream(RecyclableMemoryStreamManager, Guid)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public RecyclableMemoryStream(RecyclableMemoryStreamManager memoryManager, Guid id)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>memoryManager</code> <a class="xref" href="Fantasy.IO.RecyclableMemoryStreamManager.html">RecyclableMemoryStreamManager</a></dt>
    <dd></dd>
    <dt><code>id</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.guid">Guid</a></dt>
    <dd></dd>
  </dl>












  <a id="Fantasy_IO_RecyclableMemoryStream__ctor_" data-uid="Fantasy.IO.RecyclableMemoryStream.#ctor*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream__ctor_Fantasy_IO_RecyclableMemoryStreamManager_System_Guid_System_String_" data-uid="Fantasy.IO.RecyclableMemoryStream.#ctor(Fantasy.IO.RecyclableMemoryStreamManager,System.Guid,System.String)">
  RecyclableMemoryStream(RecyclableMemoryStreamManager, Guid, string)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public RecyclableMemoryStream(RecyclableMemoryStreamManager memoryManager, Guid id, string tag)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>memoryManager</code> <a class="xref" href="Fantasy.IO.RecyclableMemoryStreamManager.html">RecyclableMemoryStreamManager</a></dt>
    <dd></dd>
    <dt><code>id</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.guid">Guid</a></dt>
    <dd></dd>
    <dt><code>tag</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
    <dd></dd>
  </dl>












  <a id="Fantasy_IO_RecyclableMemoryStream__ctor_" data-uid="Fantasy.IO.RecyclableMemoryStream.#ctor*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream__ctor_Fantasy_IO_RecyclableMemoryStreamManager_System_Guid_System_String_System_Int32_" data-uid="Fantasy.IO.RecyclableMemoryStream.#ctor(Fantasy.IO.RecyclableMemoryStreamManager,System.Guid,System.String,System.Int32)">
  RecyclableMemoryStream(RecyclableMemoryStreamManager, Guid, string, int)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public RecyclableMemoryStream(RecyclableMemoryStreamManager memoryManager, Guid id, string tag, int requestedSize)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>memoryManager</code> <a class="xref" href="Fantasy.IO.RecyclableMemoryStreamManager.html">RecyclableMemoryStreamManager</a></dt>
    <dd></dd>
    <dt><code>id</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.guid">Guid</a></dt>
    <dd></dd>
    <dt><code>tag</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
    <dd></dd>
    <dt><code>requestedSize</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
  </dl>












  <a id="Fantasy_IO_RecyclableMemoryStream__ctor_" data-uid="Fantasy.IO.RecyclableMemoryStream.#ctor*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream__ctor_Fantasy_IO_RecyclableMemoryStreamManager_System_Guid_System_String_System_Int64_" data-uid="Fantasy.IO.RecyclableMemoryStream.#ctor(Fantasy.IO.RecyclableMemoryStreamManager,System.Guid,System.String,System.Int64)">
  RecyclableMemoryStream(RecyclableMemoryStreamManager, Guid, string, long)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public RecyclableMemoryStream(RecyclableMemoryStreamManager memoryManager, Guid id, string tag, long requestedSize)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>memoryManager</code> <a class="xref" href="Fantasy.IO.RecyclableMemoryStreamManager.html">RecyclableMemoryStreamManager</a></dt>
    <dd></dd>
    <dt><code>id</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.guid">Guid</a></dt>
    <dd></dd>
    <dt><code>tag</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
    <dd></dd>
    <dt><code>requestedSize</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd></dd>
  </dl>












  <a id="Fantasy_IO_RecyclableMemoryStream__ctor_" data-uid="Fantasy.IO.RecyclableMemoryStream.#ctor*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream__ctor_Fantasy_IO_RecyclableMemoryStreamManager_System_String_" data-uid="Fantasy.IO.RecyclableMemoryStream.#ctor(Fantasy.IO.RecyclableMemoryStreamManager,System.String)">
  RecyclableMemoryStream(RecyclableMemoryStreamManager, string)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public RecyclableMemoryStream(RecyclableMemoryStreamManager memoryManager, string tag)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>memoryManager</code> <a class="xref" href="Fantasy.IO.RecyclableMemoryStreamManager.html">RecyclableMemoryStreamManager</a></dt>
    <dd></dd>
    <dt><code>tag</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
    <dd></dd>
  </dl>












  <a id="Fantasy_IO_RecyclableMemoryStream__ctor_" data-uid="Fantasy.IO.RecyclableMemoryStream.#ctor*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream__ctor_Fantasy_IO_RecyclableMemoryStreamManager_System_String_System_Int32_" data-uid="Fantasy.IO.RecyclableMemoryStream.#ctor(Fantasy.IO.RecyclableMemoryStreamManager,System.String,System.Int32)">
  RecyclableMemoryStream(RecyclableMemoryStreamManager, string, int)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public RecyclableMemoryStream(RecyclableMemoryStreamManager memoryManager, string tag, int requestedSize)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>memoryManager</code> <a class="xref" href="Fantasy.IO.RecyclableMemoryStreamManager.html">RecyclableMemoryStreamManager</a></dt>
    <dd></dd>
    <dt><code>tag</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
    <dd></dd>
    <dt><code>requestedSize</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
  </dl>












  <a id="Fantasy_IO_RecyclableMemoryStream__ctor_" data-uid="Fantasy.IO.RecyclableMemoryStream.#ctor*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream__ctor_Fantasy_IO_RecyclableMemoryStreamManager_System_String_System_Int64_" data-uid="Fantasy.IO.RecyclableMemoryStream.#ctor(Fantasy.IO.RecyclableMemoryStreamManager,System.String,System.Int64)">
  RecyclableMemoryStream(RecyclableMemoryStreamManager, string, long)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public RecyclableMemoryStream(RecyclableMemoryStreamManager memoryManager, string tag, long requestedSize)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>memoryManager</code> <a class="xref" href="Fantasy.IO.RecyclableMemoryStreamManager.html">RecyclableMemoryStreamManager</a></dt>
    <dd></dd>
    <dt><code>tag</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
    <dd></dd>
    <dt><code>requestedSize</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd></dd>
  </dl>












  <h2 class="section" id="properties">属性
</h2>


  <a id="Fantasy_IO_RecyclableMemoryStream_CanRead_" data-uid="Fantasy.IO.RecyclableMemoryStream.CanRead*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_CanRead" data-uid="Fantasy.IO.RecyclableMemoryStream.CanRead">
  CanRead
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public override bool CanRead { get; }</code></pre>
  </div>





  <h4 class="section">属性值</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
    <dd></dd>
  </dl>








  <a id="Fantasy_IO_RecyclableMemoryStream_CanSeek_" data-uid="Fantasy.IO.RecyclableMemoryStream.CanSeek*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_CanSeek" data-uid="Fantasy.IO.RecyclableMemoryStream.CanSeek">
  CanSeek
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public override bool CanSeek { get; }</code></pre>
  </div>





  <h4 class="section">属性值</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
    <dd></dd>
  </dl>








  <a id="Fantasy_IO_RecyclableMemoryStream_CanTimeout_" data-uid="Fantasy.IO.RecyclableMemoryStream.CanTimeout*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_CanTimeout" data-uid="Fantasy.IO.RecyclableMemoryStream.CanTimeout">
  CanTimeout
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public override bool CanTimeout { get; }</code></pre>
  </div>





  <h4 class="section">属性值</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
    <dd></dd>
  </dl>








  <a id="Fantasy_IO_RecyclableMemoryStream_CanWrite_" data-uid="Fantasy.IO.RecyclableMemoryStream.CanWrite*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_CanWrite" data-uid="Fantasy.IO.RecyclableMemoryStream.CanWrite">
  CanWrite
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public override bool CanWrite { get; }</code></pre>
  </div>





  <h4 class="section">属性值</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
    <dd></dd>
  </dl>








  <a id="Fantasy_IO_RecyclableMemoryStream_Capacity_" data-uid="Fantasy.IO.RecyclableMemoryStream.Capacity*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_Capacity" data-uid="Fantasy.IO.RecyclableMemoryStream.Capacity">
  Capacity
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public override int Capacity { get; set; }</code></pre>
  </div>





  <h4 class="section">属性值</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
  </dl>








  <a id="Fantasy_IO_RecyclableMemoryStream_Capacity64_" data-uid="Fantasy.IO.RecyclableMemoryStream.Capacity64*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_Capacity64" data-uid="Fantasy.IO.RecyclableMemoryStream.Capacity64">
  Capacity64
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public long Capacity64 { get; set; }</code></pre>
  </div>





  <h4 class="section">属性值</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd></dd>
  </dl>








  <a id="Fantasy_IO_RecyclableMemoryStream_Length_" data-uid="Fantasy.IO.RecyclableMemoryStream.Length*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_Length" data-uid="Fantasy.IO.RecyclableMemoryStream.Length">
  Length
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public override long Length { get; }</code></pre>
  </div>





  <h4 class="section">属性值</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd></dd>
  </dl>








  <a id="Fantasy_IO_RecyclableMemoryStream_Position_" data-uid="Fantasy.IO.RecyclableMemoryStream.Position*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_Position" data-uid="Fantasy.IO.RecyclableMemoryStream.Position">
  Position
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public override long Position { get; set; }</code></pre>
  </div>





  <h4 class="section">属性值</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd></dd>
  </dl>








  <h2 class="section" id="methods">方法
</h2>


  <a id="Fantasy_IO_RecyclableMemoryStream_Advance_" data-uid="Fantasy.IO.RecyclableMemoryStream.Advance*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_Advance_System_Int32_" data-uid="Fantasy.IO.RecyclableMemoryStream.Advance(System.Int32)">
  Advance(int)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public void Advance(int count)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>count</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
  </dl>












  <a id="Fantasy_IO_RecyclableMemoryStream_Close_" data-uid="Fantasy.IO.RecyclableMemoryStream.Close*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_Close" data-uid="Fantasy.IO.RecyclableMemoryStream.Close">
  Close()
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public override void Close()</code></pre>
  </div>













  <a id="Fantasy_IO_RecyclableMemoryStream_CopyTo_" data-uid="Fantasy.IO.RecyclableMemoryStream.CopyTo*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_CopyTo_System_IO_Stream_System_Int32_" data-uid="Fantasy.IO.RecyclableMemoryStream.CopyTo(System.IO.Stream,System.Int32)">
  CopyTo(Stream, int)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public override void CopyTo(Stream destination, int bufferSize)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>destination</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a></dt>
    <dd></dd>
    <dt><code>bufferSize</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
  </dl>












  <a id="Fantasy_IO_RecyclableMemoryStream_CopyToAsync_" data-uid="Fantasy.IO.RecyclableMemoryStream.CopyToAsync*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_CopyToAsync_System_IO_Stream_System_Int32_System_Threading_CancellationToken_" data-uid="Fantasy.IO.RecyclableMemoryStream.CopyToAsync(System.IO.Stream,System.Int32,System.Threading.CancellationToken)">
  CopyToAsync(Stream, int, CancellationToken)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public override Task CopyToAsync(Stream destination, int bufferSize, CancellationToken cancellationToken)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>destination</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a></dt>
    <dd></dd>
    <dt><code>bufferSize</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
    <dt><code>cancellationToken</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken">CancellationToken</a></dt>
    <dd></dd>
  </dl>

  <h4 class="section">返回</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.threading.tasks.task">Task</a></dt>
    <dd></dd>
  </dl>











  <a id="Fantasy_IO_RecyclableMemoryStream_Dispose_" data-uid="Fantasy.IO.RecyclableMemoryStream.Dispose*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_Dispose_System_Boolean_" data-uid="Fantasy.IO.RecyclableMemoryStream.Dispose(System.Boolean)">
  Dispose(bool)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">protected override void Dispose(bool disposing)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>disposing</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
    <dd></dd>
  </dl>












  <a id="Fantasy_IO_RecyclableMemoryStream_Finalize_" data-uid="Fantasy.IO.RecyclableMemoryStream.Finalize*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_Finalize" data-uid="Fantasy.IO.RecyclableMemoryStream.Finalize">
  ~RecyclableMemoryStream()
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">protected ~RecyclableMemoryStream()</code></pre>
  </div>













  <a id="Fantasy_IO_RecyclableMemoryStream_GetBuffer_" data-uid="Fantasy.IO.RecyclableMemoryStream.GetBuffer*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_GetBuffer" data-uid="Fantasy.IO.RecyclableMemoryStream.GetBuffer">
  GetBuffer()
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public override byte[] GetBuffer()</code></pre>
  </div>


  <h4 class="section">返回</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.byte">byte</a>[]</dt>
    <dd></dd>
  </dl>











  <a id="Fantasy_IO_RecyclableMemoryStream_GetMemory_" data-uid="Fantasy.IO.RecyclableMemoryStream.GetMemory*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_GetMemory_System_Int32_" data-uid="Fantasy.IO.RecyclableMemoryStream.GetMemory(System.Int32)">
  GetMemory(int)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public Memory&lt;byte&gt; GetMemory(int sizeHint = 0)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>sizeHint</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
  </dl>

  <h4 class="section">返回</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.memory-1">Memory</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.byte">byte</a>&gt;</dt>
    <dd></dd>
  </dl>











  <a id="Fantasy_IO_RecyclableMemoryStream_GetReadOnlySequence_" data-uid="Fantasy.IO.RecyclableMemoryStream.GetReadOnlySequence*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_GetReadOnlySequence" data-uid="Fantasy.IO.RecyclableMemoryStream.GetReadOnlySequence">
  GetReadOnlySequence()
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public ReadOnlySequence&lt;byte&gt; GetReadOnlySequence()</code></pre>
  </div>


  <h4 class="section">返回</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.buffers.readonlysequence-1">ReadOnlySequence</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.byte">byte</a>&gt;</dt>
    <dd></dd>
  </dl>











  <a id="Fantasy_IO_RecyclableMemoryStream_GetSpan_" data-uid="Fantasy.IO.RecyclableMemoryStream.GetSpan*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_GetSpan_System_Int32_" data-uid="Fantasy.IO.RecyclableMemoryStream.GetSpan(System.Int32)">
  GetSpan(int)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public Span&lt;byte&gt; GetSpan(int sizeHint = 0)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>sizeHint</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
  </dl>

  <h4 class="section">返回</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.span-1">Span</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.byte">byte</a>&gt;</dt>
    <dd></dd>
  </dl>











  <a id="Fantasy_IO_RecyclableMemoryStream_Read_" data-uid="Fantasy.IO.RecyclableMemoryStream.Read*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_Read_System_Byte___System_Int32_System_Int32_" data-uid="Fantasy.IO.RecyclableMemoryStream.Read(System.Byte[],System.Int32,System.Int32)">
  Read(byte[], int, int)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public override int Read(byte[] buffer, int offset, int count)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>buffer</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.byte">byte</a>[]</dt>
    <dd></dd>
    <dt><code>offset</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
    <dt><code>count</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
  </dl>

  <h4 class="section">返回</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
  </dl>











  <a id="Fantasy_IO_RecyclableMemoryStream_Read_" data-uid="Fantasy.IO.RecyclableMemoryStream.Read*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_Read_System_Span_System_Byte__" data-uid="Fantasy.IO.RecyclableMemoryStream.Read(System.Span{System.Byte})">
  Read(Span&lt;byte&gt;)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public override int Read(Span&lt;byte&gt; buffer)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>buffer</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.span-1">Span</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.byte">byte</a>&gt;</dt>
    <dd></dd>
  </dl>

  <h4 class="section">返回</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
  </dl>











  <a id="Fantasy_IO_RecyclableMemoryStream_ReadByte_" data-uid="Fantasy.IO.RecyclableMemoryStream.ReadByte*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_ReadByte" data-uid="Fantasy.IO.RecyclableMemoryStream.ReadByte">
  ReadByte()
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public override int ReadByte()</code></pre>
  </div>


  <h4 class="section">返回</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
  </dl>











  <a id="Fantasy_IO_RecyclableMemoryStream_SafeRead_" data-uid="Fantasy.IO.RecyclableMemoryStream.SafeRead*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_SafeRead_System_Byte___System_Int32_System_Int32_System_Int32__" data-uid="Fantasy.IO.RecyclableMemoryStream.SafeRead(System.Byte[],System.Int32,System.Int32,System.Int32@)">
  SafeRead(byte[], int, int, ref int)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public int SafeRead(byte[] buffer, int offset, int count, ref int streamPosition)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>buffer</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.byte">byte</a>[]</dt>
    <dd></dd>
    <dt><code>offset</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
    <dt><code>count</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
    <dt><code>streamPosition</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
  </dl>

  <h4 class="section">返回</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
  </dl>











  <a id="Fantasy_IO_RecyclableMemoryStream_SafeRead_" data-uid="Fantasy.IO.RecyclableMemoryStream.SafeRead*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_SafeRead_System_Byte___System_Int32_System_Int32_System_Int64__" data-uid="Fantasy.IO.RecyclableMemoryStream.SafeRead(System.Byte[],System.Int32,System.Int32,System.Int64@)">
  SafeRead(byte[], int, int, ref long)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public int SafeRead(byte[] buffer, int offset, int count, ref long streamPosition)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>buffer</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.byte">byte</a>[]</dt>
    <dd></dd>
    <dt><code>offset</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
    <dt><code>count</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
    <dt><code>streamPosition</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd></dd>
  </dl>

  <h4 class="section">返回</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
  </dl>











  <a id="Fantasy_IO_RecyclableMemoryStream_SafeRead_" data-uid="Fantasy.IO.RecyclableMemoryStream.SafeRead*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_SafeRead_System_Span_System_Byte__System_Int32__" data-uid="Fantasy.IO.RecyclableMemoryStream.SafeRead(System.Span{System.Byte},System.Int32@)">
  SafeRead(Span&lt;byte&gt;, ref int)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public int SafeRead(Span&lt;byte&gt; buffer, ref int streamPosition)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>buffer</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.span-1">Span</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.byte">byte</a>&gt;</dt>
    <dd></dd>
    <dt><code>streamPosition</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
  </dl>

  <h4 class="section">返回</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
  </dl>











  <a id="Fantasy_IO_RecyclableMemoryStream_SafeRead_" data-uid="Fantasy.IO.RecyclableMemoryStream.SafeRead*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_SafeRead_System_Span_System_Byte__System_Int64__" data-uid="Fantasy.IO.RecyclableMemoryStream.SafeRead(System.Span{System.Byte},System.Int64@)">
  SafeRead(Span&lt;byte&gt;, ref long)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public int SafeRead(Span&lt;byte&gt; buffer, ref long streamPosition)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>buffer</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.span-1">Span</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.byte">byte</a>&gt;</dt>
    <dd></dd>
    <dt><code>streamPosition</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd></dd>
  </dl>

  <h4 class="section">返回</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
  </dl>











  <a id="Fantasy_IO_RecyclableMemoryStream_SafeReadByte_" data-uid="Fantasy.IO.RecyclableMemoryStream.SafeReadByte*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_SafeReadByte_System_Int32__" data-uid="Fantasy.IO.RecyclableMemoryStream.SafeReadByte(System.Int32@)">
  SafeReadByte(ref int)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public int SafeReadByte(ref int streamPosition)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>streamPosition</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
  </dl>

  <h4 class="section">返回</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
  </dl>











  <a id="Fantasy_IO_RecyclableMemoryStream_SafeReadByte_" data-uid="Fantasy.IO.RecyclableMemoryStream.SafeReadByte*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_SafeReadByte_System_Int64__" data-uid="Fantasy.IO.RecyclableMemoryStream.SafeReadByte(System.Int64@)">
  SafeReadByte(ref long)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public int SafeReadByte(ref long streamPosition)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>streamPosition</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd></dd>
  </dl>

  <h4 class="section">返回</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
  </dl>











  <a id="Fantasy_IO_RecyclableMemoryStream_Seek_" data-uid="Fantasy.IO.RecyclableMemoryStream.Seek*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_Seek_System_Int64_System_IO_SeekOrigin_" data-uid="Fantasy.IO.RecyclableMemoryStream.Seek(System.Int64,System.IO.SeekOrigin)">
  Seek(long, SeekOrigin)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public override long Seek(long offset, SeekOrigin loc)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>offset</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd></dd>
    <dt><code>loc</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.seekorigin">SeekOrigin</a></dt>
    <dd></dd>
  </dl>

  <h4 class="section">返回</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd></dd>
  </dl>











  <a id="Fantasy_IO_RecyclableMemoryStream_SetLength_" data-uid="Fantasy.IO.RecyclableMemoryStream.SetLength*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_SetLength_System_Int64_" data-uid="Fantasy.IO.RecyclableMemoryStream.SetLength(System.Int64)">
  SetLength(long)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public override void SetLength(long value)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>value</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd></dd>
  </dl>












  <a id="Fantasy_IO_RecyclableMemoryStream_ToArray_" data-uid="Fantasy.IO.RecyclableMemoryStream.ToArray*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_ToArray" data-uid="Fantasy.IO.RecyclableMemoryStream.ToArray">
  ToArray()
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">[Obsolete(&quot;This method has degraded performance vs. GetBuffer and should be avoided.&quot;)]
public override byte[] ToArray()</code></pre>
  </div>


  <h4 class="section">返回</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.byte">byte</a>[]</dt>
    <dd></dd>
  </dl>











  <a id="Fantasy_IO_RecyclableMemoryStream_ToString_" data-uid="Fantasy.IO.RecyclableMemoryStream.ToString*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_ToString" data-uid="Fantasy.IO.RecyclableMemoryStream.ToString">
  ToString()
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public override string ToString()</code></pre>
  </div>


  <h4 class="section">返回</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.string">string</a></dt>
    <dd></dd>
  </dl>











  <a id="Fantasy_IO_RecyclableMemoryStream_TryGetBuffer_" data-uid="Fantasy.IO.RecyclableMemoryStream.TryGetBuffer*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_TryGetBuffer_System_ArraySegment_System_Byte___" data-uid="Fantasy.IO.RecyclableMemoryStream.TryGetBuffer(System.ArraySegment{System.Byte}@)">
  TryGetBuffer(out ArraySegment&lt;byte&gt;)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public override bool TryGetBuffer(out ArraySegment&lt;byte&gt; buffer)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>buffer</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.arraysegment-1">ArraySegment</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.byte">byte</a>&gt;</dt>
    <dd></dd>
  </dl>

  <h4 class="section">返回</h4>
  <dl class="parameters">
    <dt><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.boolean">bool</a></dt>
    <dd></dd>
  </dl>











  <a id="Fantasy_IO_RecyclableMemoryStream_Write_" data-uid="Fantasy.IO.RecyclableMemoryStream.Write*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_Write_System_Byte___System_Int32_System_Int32_" data-uid="Fantasy.IO.RecyclableMemoryStream.Write(System.Byte[],System.Int32,System.Int32)">
  Write(byte[], int, int)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public override void Write(byte[] buffer, int offset, int count)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>buffer</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.byte">byte</a>[]</dt>
    <dd></dd>
    <dt><code>offset</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
    <dt><code>count</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
  </dl>












  <a id="Fantasy_IO_RecyclableMemoryStream_Write_" data-uid="Fantasy.IO.RecyclableMemoryStream.Write*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_Write_System_ReadOnlySpan_System_Byte__" data-uid="Fantasy.IO.RecyclableMemoryStream.Write(System.ReadOnlySpan{System.Byte})">
  Write(ReadOnlySpan&lt;byte&gt;)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public override void Write(ReadOnlySpan&lt;byte&gt; source)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>source</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.readonlyspan-1">ReadOnlySpan</a>&lt;<a class="xref" href="https://learn.microsoft.com/dotnet/api/system.byte">byte</a>&gt;</dt>
    <dd></dd>
  </dl>












  <a id="Fantasy_IO_RecyclableMemoryStream_WriteByte_" data-uid="Fantasy.IO.RecyclableMemoryStream.WriteByte*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_WriteByte_System_Byte_" data-uid="Fantasy.IO.RecyclableMemoryStream.WriteByte(System.Byte)">
  WriteByte(byte)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public override void WriteByte(byte value)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>value</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.byte">byte</a></dt>
    <dd></dd>
  </dl>












  <a id="Fantasy_IO_RecyclableMemoryStream_WriteTo_" data-uid="Fantasy.IO.RecyclableMemoryStream.WriteTo*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_WriteTo_System_Byte___" data-uid="Fantasy.IO.RecyclableMemoryStream.WriteTo(System.Byte[])">
  WriteTo(byte[])
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public void WriteTo(byte[] buffer)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>buffer</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.byte">byte</a>[]</dt>
    <dd></dd>
  </dl>












  <a id="Fantasy_IO_RecyclableMemoryStream_WriteTo_" data-uid="Fantasy.IO.RecyclableMemoryStream.WriteTo*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_WriteTo_System_Byte___System_Int64_System_Int64_" data-uid="Fantasy.IO.RecyclableMemoryStream.WriteTo(System.Byte[],System.Int64,System.Int64)">
  WriteTo(byte[], long, long)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public void WriteTo(byte[] buffer, long offset, long count)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>buffer</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.byte">byte</a>[]</dt>
    <dd></dd>
    <dt><code>offset</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd></dd>
    <dt><code>count</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd></dd>
  </dl>












  <a id="Fantasy_IO_RecyclableMemoryStream_WriteTo_" data-uid="Fantasy.IO.RecyclableMemoryStream.WriteTo*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_WriteTo_System_Byte___System_Int64_System_Int64_System_Int32_" data-uid="Fantasy.IO.RecyclableMemoryStream.WriteTo(System.Byte[],System.Int64,System.Int64,System.Int32)">
  WriteTo(byte[], long, long, int)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public void WriteTo(byte[] buffer, long offset, long count, int targetOffset)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>buffer</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.byte">byte</a>[]</dt>
    <dd></dd>
    <dt><code>offset</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd></dd>
    <dt><code>count</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd></dd>
    <dt><code>targetOffset</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
  </dl>












  <a id="Fantasy_IO_RecyclableMemoryStream_WriteTo_" data-uid="Fantasy.IO.RecyclableMemoryStream.WriteTo*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_WriteTo_System_IO_Stream_" data-uid="Fantasy.IO.RecyclableMemoryStream.WriteTo(System.IO.Stream)">
  WriteTo(Stream)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public override void WriteTo(Stream stream)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>stream</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a></dt>
    <dd></dd>
  </dl>












  <a id="Fantasy_IO_RecyclableMemoryStream_WriteTo_" data-uid="Fantasy.IO.RecyclableMemoryStream.WriteTo*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_WriteTo_System_IO_Stream_System_Int32_System_Int32_" data-uid="Fantasy.IO.RecyclableMemoryStream.WriteTo(System.IO.Stream,System.Int32,System.Int32)">
  WriteTo(Stream, int, int)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public void WriteTo(Stream stream, int offset, int count)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>stream</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a></dt>
    <dd></dd>
    <dt><code>offset</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
    <dt><code>count</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int32">int</a></dt>
    <dd></dd>
  </dl>












  <a id="Fantasy_IO_RecyclableMemoryStream_WriteTo_" data-uid="Fantasy.IO.RecyclableMemoryStream.WriteTo*"></a>

  <h3 id="Fantasy_IO_RecyclableMemoryStream_WriteTo_System_IO_Stream_System_Int64_System_Int64_" data-uid="Fantasy.IO.RecyclableMemoryStream.WriteTo(System.IO.Stream,System.Int64,System.Int64)">
  WriteTo(Stream, long, long)
  
  </h3>

  <div class="markdown level1 summary"></div>
  <div class="markdown level1 conceptual"></div>

  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public void WriteTo(Stream stream, long offset, long count)</code></pre>
  </div>

  <h4 class="section">参数</h4>
  <dl class="parameters">
    <dt><code>stream</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.io.stream">Stream</a></dt>
    <dd></dd>
    <dt><code>offset</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd></dd>
    <dt><code>count</code> <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.int64">long</a></dt>
    <dd></dd>
  </dl>













</article>


        
      </div>

      <div class="affix">
        <nav id="affix"></nav>
      </div>
    </main>

    <div class="container-xxl search-results" id="search-results"></div>

    <footer class="border-top">
      <div class="container-xxl">
        <div class="flex-fill">
          <span>Made with <a href="https://dotnet.github.io/docfx">docfx</a></span>
        </div>
      </div>
    </footer>
  </body>
</html>